package com.ajun.controller;

import com.ajun.common.entity.R;
import com.ajun.entity.Order;
import com.ajun.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Order 控制器
 *
 * @author LiJun
 * @date 2021-07-15
 */
@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService orderService;

    @PostMapping("/create")
    public R<Boolean> createOrder(@RequestBody Order order) {
        return orderService.createOrder(order);
    }
}
